package kr.hkit.powerjava.chapter09;

class Point {
	private int x, y;

	public Point(int a, int b) {
		x = a;
		y = b;
	}

	
	public void setPoint(int x, int y) {
		this.x = x;
		this.y = y;
	}


	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}


	@Override
	public String toString() {
		return "Point [x=" + x + ", y=" + y + "]";
	}

}

class Circle {
	private int radius = 0;
	private Point center;
	public static final double PI = 3.14;

	public Circle(Point p, int r) {
		center = p;
		radius = r;
	}

	public Point getCenter() {
		return center;
	}

	public void setRadius(int radius){
		this.radius = radius;
	}

	@Override
	public String toString() {
		return "Circle [radius=" + radius + ", " + center + "]";
	}

}

public class CircleTest {
	public static void main(String[] args) {
		Point p = new Point(25, 78);
		Circle c = new Circle(p, 10);

		p.setPoint(50, 10);
		c.setRadius(15);

		System.out.println(c);
		
		c.setRadius(30);
		Point p1 =c.getCenter();
		
		p1.setPoint(10, 20);
		System.out.println(c);
		
		/*Math m = new Math();
		m.sqrt(9);     
		
		- 정적메소드라서 인스턴스화 하지 않고도 바로 쓸 수 있다 
		*/
		
		System.out.println(Math.sqrt(9));
	}
}
